<template>
    <div>
        <li @click='isConfirmed=true'>保存电脑</li>
    </div>
</template>
<script>
export default {
  data() {
    return {
        isConfirmed:false
    };
  },
  beforeRouteLeave(to,from,next){
      console.log('路由离开')
      console.log('beforeRouteLeave')
      if(this.zhuanyi){
          next();
      }else{
          if(confirm('确定要离开吗?')){
              next()
          }
          else{
              next(false)
          }
      }
  }
};
</script>
<style scoped>
</style>

